<?php
// Get JobID
$id = $_GET['id'];
// Security
if( !is_numeric( $id ) )
{
        die( '<div class="message error">
      <h3>Error</h3>
	  <p>There are no jobs listed in our database with the JobID you provided, please contact an administrator if this issue continues to occur.</p></div>' );     
}
// Query Database
$query = @mysql_query( "SELECT `JobID`, `JobTitle`,  `Employer`,  `Description`,  `ContactNumber`,  `ContactEmail`, `Wage`, `Hours`, `Timestamp` FROM `jobs` WHERE `JobID` = '{$id}' ORDER BY `JobID` DESC LIMIT 1;" ) or die( 'Query Error: ' . mysql_error()); 
// Check if database returns a problem or not
$row = mysql_fetch_object( $query );
?>
	<div class="path">
			
	<a href="index.php"><?php print $lang->admin->dashboard; ?></a> > <a href="#"><?php print $lang->admin->jobmanagement; ?></a> > <a href="#">Edit <?php echo $row->JobTitle; ?> Job</a></div>

  <div class="main">		
		
		<div class="content">

			<h1>Edit <?php echo $row->JobTitle; ?> Job</h1>
            <div class="descr"><?php print $lang->admin->editjobdesc; ?></div>
<p><form name="editjob" method="post" action="index.php?do=editjob"><strong><?php print $lang->admin->jobsubmitted; ?>:</strong> <?php echo $row->Timestamp; ?><br />
  <strong><?php print $lang->admin->employer; ?>:</strong> <input name="employer" type="text" id="employer" value="<?php echo $row->Employer; ?>"><br />
  <strong><?php print $lang->admin->jobtitle; ?>:</strong> <input name="jobtitle" type="text" id="jobtitle" value="<?php echo $row->JobTitle; ?>"><br />
  <strong><?php print $lang->admin->contactnumber; ?>:</strong> <input name="contactnumber" type="text" id="contactnumber" value="<?php echo $row->ContactNumber; ?>"><br />
  <strong><?php print $lang->admin->contactemail; ?>:</strong> <input name="contactemail" type="text" id="contactemail" value="<?php echo $row->ContactEmail; ?>"><br />
  <strong><?php print $lang->admin->wage; ?>:</strong> <input name="wage" type="text" id="wage" value="<?php echo $row->Wage; ?>"><br />
  <strong><?php print $lang->admin->hours; ?>:</strong> <input name="hours" type="text" id="hours" value="<?php echo $row->Hours; ?>"><br />
  <strong><?php print $lang->admin->jobdescription; ?></strong><br />
<textarea name="description" id="description" cols="65" rows="5"><?php echo $row->Description; ?></textarea>
<div class="path"><input name="jobid" type="hidden" id="jobid" value="<?php echo $row->JobID; ?>"><label><input type="submit" name="button" id="button" value="<?php print $lang->admin->updatesettings; ?>"></label></div></form>
</p>
</div>